

jQuery(function ($) {
    if($('.head_nav li').length>1){
        $('.head_nav').append('<li class="aboutUs"><a>关注我们</a></li>');
        var weiboHtml ='<a href="https://weibo.com/u/5912031881?is_all=1" target="_blank">新浪微博</a>'
        $('.weibo').html(weiboHtml);
        var weixinHtml = '<img src="/asset/image/weixinCode.png" alt=""></img>';
        $('.weixin_img').html(weixinHtml)
        $('.aboutUs').mouseenter(function () {
                $('.top_guanzhu_ab').show();
                $('.top_guanzhu_ab').mouseenter(function () {
                    $('.top_guanzhu_ab').show();
                }).mouseleave(function () {
                    $('.top_guanzhu_ab').hide();
                });
        }).mouseleave(function () {
            $('.top_guanzhu_ab').hide();
        });
    }else{
        //顶部导航
        var params = {
            "Nav[]": {
                "Nav": {
                    "type": 2,
                    "use_flag": 1,
                    "@order": "rank"
                }
            },
            "[]": {
                "Nav": {
                    "type": 5,
                    "use_flag": 1,
                    "@order": "rank"
                }
            }

        };
        send_ajax('post', '/get', params, function (data) {
            if (data.code == 200 && data['Nav[]']) {
                var navs = data['Nav[]'];
                for (var i = 0; i < navs.length; i++) {
                    $('.head_nav').append('<li><a  target="_blank" href="' + (navs[i].url) + '" >' + navs[i].name + '</a></li>');
                };
                $('.head_nav').append('<li class="aboutUs"><a>关注我们</a></li>');
                $('.aboutUs').mouseenter(function () {
                    $('.top_guanzhu_ab').show();
                    $('.top_guanzhu_ab').mouseenter(function () {
                        $('.top_guanzhu_ab').show();
                    }).mouseleave(function () {
                        $('.top_guanzhu_ab').hide();
                    });
                }).mouseleave(function () {
                    $('.top_guanzhu_ab').hide();
                });
            }
        });
    }
    
    $('.weixin').mouseenter(function () {
        $('.weixin_img').show();
    }).mouseleave( function () {
        $('.weixin_img').hide();
    });
});